package com.zhuiyun.pm.sys.stage.service.Impl;

import com.zhuiyun.pm.page.MyPageHelper;
import com.zhuiyun.pm.page.PageRequest;
import com.zhuiyun.pm.page.PageResult;
import com.zhuiyun.pm.sys.stage.entity.ClientGoodsEarnestMoneyEntity;
import com.zhuiyun.pm.sys.stage.mapper.StageMapper;
import com.zhuiyun.pm.sys.stage.service.StageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @descriptions: StageServiceImpl
 * @author: zq
 * @date: 2023/3/14 15:03
 */
@Service
public class StageServiceImpl implements StageService {
    @Resource
    StageMapper stageMapper;

    /**
     * @descriptions 查询竞品信息
     * @author zq
     * @date 2023/3/14 15:10
     * @param id
     * @return java.util.Map
     */
    @Override
    public Map getCompetitorInfo(Integer id) {
        Map stageInfo = stageMapper.getCompetitorInfo(id);
        return stageInfo;
    }

    /**
     * @descriptions 查询竞品报名人数
     * @author zq
     * @date 2023/3/14 16:52
     * @param goodsId
     * @return java.util.Map
     */
    @Override
    public Map getEnrollNum(Integer goodsId) {
        Map enrollNum = stageMapper.getEnrollNum(goodsId);
        return enrollNum;
    }

    /**
     * @descriptions 查询未缴纳保证金人数
     * @author zq
     * @date 2023/3/14 17:03
     * @param goodsId
     * @return java.util.Map
     */
    @Override
    public Map getUnpaidNum(Integer goodsId) {
        Map enrollNum = stageMapper.getUnpaidNum(goodsId);
        return enrollNum;
    }

    /**
     * @descriptions 查询缴纳保证金人数
     * @author zq
     * @date 2023/3/14 17:06
     * @param goodsId
     * @return java.util.Map
     */
    @Override
    public Map getPayNum(Integer goodsId) {
        Map enrollNum = stageMapper.getPayNum(goodsId);
        return enrollNum;
    }

    /**
     * @descriptions 查询所以报名人信息
     * @author zq
     * @date 2023/3/14 18:14
     * @param goodsId
     * @param pageRequest
     * @return com.zhuiyun.pm.page.PageResult
     */
    @Override
    public PageResult getBondInfo(Integer goodsId, PageRequest pageRequest) {
        MyPageHelper.startPage(pageRequest);
        List<Map> list = stageMapper.getBondInfo(goodsId);
        return MyPageHelper.pageInfo(list);
    }
}
